﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SheepStorage.API.Application.Command.SheepMomHistoryCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Domain.Entity;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Controllers
{
    /// <summary>
    /// 种母历史
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SheepMomHistoryController : ControllerBase
    {

        IMediator _mediator;

        ISheepMomHistoryService _res;

        public SheepMomHistoryController(IMediator _mediato,
        ISheepMomHistoryService res)
        {
            _mediator = _mediato;
            _res = res;
        }

        /// <summary>
        /// 种母历史记录列表
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Results<List<SheepMomHistory>>> ShowSheepMomHistory(ShowSheepMomHistoryCommand command)
        {
            return await _mediator.Send(command);
        }

        /// <summary>
        /// 种母历史添加
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Results<int>> AddSheepMomHistory(AddSheepMomHistoryCommand command)
        {
            return await _mediator.Send(command);
        }



        /// <summary>
        /// 种母历史批量逻辑删除
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Results<int>> DelSheepMomHistory(DelSheepMomHistoryCommand command)
        {
            return await _mediator.Send(command);
        }





    }
}
